package com.example.littleken.mytao;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

/**
 * 闪屏页activity
 */
public class SplashActivity extends AppCompatActivity {

    protected Handler handler = new Handler();
    //用handler来出来闪屏页延迟进入主界面
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        //postDelayed(Runable run ,int time);
        //经过time时间后运行run方法
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(new Intent(SplashActivity.this,MainActivity.class));
                //闪屏页跳转到主界面
            }
        },2000);
    };
}
